<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>选择住户&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</title>

<link href="${ctx}/styles/public.css" rel="stylesheet" type="text/css">
<link href="${ctx}/styles/listTable.css" rel="stylesheet" type="text/css">
<link href="${ctx}/styles/aux_window.css" rel="stylesheet" type="text/css">

<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/public.js"></script>
<script language="JavaScript"  src="${ctx}/scripts/common/prototype.js"></script>
<script language="JavaScript"  src="${ctx}/scripts/div/common.js"></script>
<script language="JavaScript" type="text/javascript">
	/***初始化所有房屋***/
	var houseNumbers = "";
	var customerNames = "";
	function init(){
		var houseNumberArray =new Array();
		var customerNamesArray = new Array();
		/***循环遍历获取房号****/
		<c:forEach var="houses" items="${moveIn.houses}" >
			houseNumberArray[houseNumberArray.length] = "${houses.value}";
		</c:forEach>
		/*******循环遍历获取业主/租户、家庭成员********/
		<c:forEach var="customer" items="${moveIn.ownerOrLessee}" >
			customerNamesArray[customerNamesArray.length] = "${customer.value.name}";
			<c:forEach var="members" items="${customer.value.members}">
				customerNamesArray[customerNamesArray.length] = "${members.value}";
			</c:forEach>
		</c:forEach>
		houseNumbers = houseNumberArray.toString();
		customerNames = customerNamesArray.toString();
	}

	function save(){
		setParentCustomer();
		setParentHouseNumber();
		windowClose();
	}
	/****设置前一个DIV的用户名****/
	function setParentCustomer(){
		if(customerNames == null ||customerNames == "") return ;
		var contextFrm = findFrame('liveIn');
		contextFrm.setCustomer(customerNames);
	}
	/****设置前一个DIV的房号***/
	function setParentHouseNumber(){
		if(houseNumbers == null || houseNumbers == "") return;
		var contextFrm = findFrame('liveIn');
		contextFrm.setHouseNumber(houseNumbers);
	}
</script>
</head>

<body onload="init();">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td class="window_head_outBg"><table border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td><span class="window_head_intext"><img src="${ctx}/images/ico_Advance.gif" align="absmiddle">&nbsp;
       	 <c:if test="${customerLinve_customerType eq 'owner'}">
      	 	 选择住户：
      	 </c:if>
      	 <c:if test="${customerLinve_customerType eq 'lessee'}">
      	 	 选择租户：
      	 </c:if>
        </span></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td class="aux_header_line_1"></td>
  </tr>
  <tr>
    <td class="aux_header_line_2"></td>
  </tr>
  <tr>
    <td class="content">
          <table width="100%" border="0" cellpadding="0" cellspacing="1" class="aux_intable_color">
	          <tr>
	            <td class="aux_titletable">
            	 <c:if test="${customerLinve_customerType eq 'owner'}">
             	 	 住户：
             	 </c:if>
             	 <c:if test="${customerLinve_customerType eq 'lessee'}">
             	 	 租户：
             	 </c:if>
	            </td>
	          </tr>

	          <tr>
	            <td  class="aux_intable_td1">
		            <table border="0" cellspacing="6" cellpadding="0">
		              <tr>
		              	<c:forEach var="ownerOrLessee" items="${moveIn.ownerOrLessee}" >
							<td>
								<input name="zh" type="checkbox" disabled="disabled" checked="checked">${ownerOrLessee.value.name}
							</td>
		              	</c:forEach>
		              </tr>
		            </table>
	            </td>
	           </tr>
	          <tr>
	            <td  class="aux_titletable">家庭成员</td>
	          </tr>
          	 <tr>
	            <td class="aux_intable_td1"><table border="0" cellspacing="6" cellpadding="0">
	              <tr>
	              	<c:forEach var="memberItems" items="${moveIn.ownerOrLessee}">
	              		<c:forEach var="memberItem" items="${memberItems.value.members}">
	              		<c:set var="isHasMember" value="true"></c:set>
						<td>
							<input name="zh" type="checkbox" value="${memberItem.key}" checked="checked" disabled="disabled">${memberItem.value}
						</td>
						</c:forEach>
	              	</c:forEach>
					<c:if test="${empty isHasMember}">
						<td>
							尚未登记家庭成员
						</td>
					</c:if>
	              </tr>
	            </table>
	           </td>
           </tr>
        </table>
          </td>
	  </tr>
    </table></td>
  </tr>
  <tr>
    <td colspan="2" class="window_footer">      <table border="0" cellspacing="0" cellpadding="0">
        <tr>
		  <td><table border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td class="buttonOffLeft" id="btn1_21"></td>
                <td class="buttonOffMiddle" id="btn1_22" onClick="save();" onMouseOver="btn_change_over(2)" onMouseOut="btn_change_out(2)" onBlur="btn_change(2)"><img src="${ctx}/images/ico_ok.gif" alt="" width="14" height="14" border="0" align="absbottom">保存</td>
                <td class="buttonOffRight" id="btn1_23"></td>
              </tr>
          </table></td>
          <td class="btn_between_space"></td>
          <td><table border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td class="buttonOffLeft" id="btn1_31"></td>
                <td class="buttonOffMiddle" id="btn1_32" onClick="windowClose();" onMouseOver="btn_change_over(3)" onMouseOut="btn_change_out(3)" onBlur="btn_change(3)"><img src="${ctx}/images/ico_cancel.gif" alt="" width="14" height="14" border="0" align="absbottom">关闭</td>
                <td class="buttonOffRight" id="btn1_33"></td>
              </tr>
          </table></td>
        </tr>
          </table>
      <p>&nbsp;</p></td>
  </tr>
</table>
</body>
